% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils_speedtest.R
\name{speedtest}
\alias{speedtest}
\title{Run EJAM analysis for several radii and numbers of sitepoints, recording how long each step takes}
\usage{
speedtest(
  n = 10,
  sitepoints = NULL,
  weighting = "frs",
  radii = c(1, 3.106856, 5, 10, 31.06856)[1:3],
  avoidorphans = FALSE,
  test_ejamit = FALSE,
  test_getblocksnearby = TRUE,
  test_doaggregate = TRUE,
  test_batch.summarize = FALSE,
  logging = FALSE,
  logfolder = ".",
  logfilename = "log_n_datetime.txt",
  honk_when_ready = TRUE,
  saveoutput = FALSE,
  plot = TRUE,
  getblocks_diagnostics_shown = FALSE,
  ...
)
}
\arguments{
\item{n}{optional, vector of 1 or more counts of how many random points to test, or
set to 0 to interactively pick file of points in RStudio (n is ignored if sitepoints provided)}

\item{sitepoints}{optional,  (use if you do not want random points) data.frame of points or
path/file with points, where columns are lat and lon in decimal degrees}

\item{weighting}{optional, if using random points, how to weight them,
such as facilities, people, or blockgroups. see \code{\link[=testpoints_n]{testpoints_n()}}}

\item{radii}{optional, one or more radius values in miles
to use in creating circular buffers when findings residents nearby each of sitepoints.
The default list includes one that is 5km (approx 3.1 miles)}

\item{avoidorphans}{see \code{\link[=getblocksnearby]{getblocksnearby()}} or \code{\link[=ejamit]{ejamit()}} regarding this param}

\item{test_ejamit}{whether to test only ejamit()
instead of its subcomponents like getblocksnearby(), doaggregate(), etc}

\item{test_getblocksnearby}{whether to include this function in timing - not used because always done}

\item{test_doaggregate}{whether to include this function in timing}

\item{test_batch.summarize}{whether to include this function in timing}

\item{logging}{logical optional, whether to save log file with timings of steps.
NOTE this slows it down though.}

\item{logfolder}{optional, name of folder for log file}

\item{logfilename}{optional, name of log file to go in folder}

\item{honk_when_ready}{optional, self-explanatory}

\item{saveoutput}{but this slows it down if set to TRUE to save each run as .rda file}

\item{plot}{whether to create plot of results}

\item{getblocks_diagnostics_shown}{set TRUE to see more details on block counts etc.}

\item{...}{passed to plotting function}
}
\value{
EJAM results similar to as from the web app or \code{\link[=ejamit]{ejamit()}} and also creates a plot
}
\description{
Run EJAM analysis for several radii and numbers of sitepoints, recording how long each step takes
}
\details{
This is essentially a test script that times each step of EJAM for a large dataset
\itemize{
\item pick a sample size (n) (or enter sitepoints, or set n=0 to interactively pick file of points in RStudio)
\item pick n random points
\item pick a few different radii for circular buffering
\item analyze indicators in circular buffers and overall (find blocks nearby and then calc indicators)
\item get stats that summarize those indicators
\item compare times between steps and radii and other approaches or tools
}
}
\examples{
\dontrun{ 
  speedseen_few <- speedtest(c(50,500), radii=c(1, 3.106856), logging=FALSE, honk=FALSE)
  
  speedseen_nearer_to1k <- speedtest(n = c(1e2,1e3,1e4 ), radii=c(1, 3.106856,5 ),
    logging=TRUE, honk=FALSE)
  save( speedseen_nearer_to1k, file = "~/../Downloads/speedseen_nearer_to1k.rda")
  rstudioapi::savePlotAsImage(        "~/../Downloads/speedseen_nearer_to1k.png")
  
  speedseen_all <- speedtest(
    n = c(1e2,1e3,1e4), 
    radii=c(1, 3.106856, 5, 10, 31.06856), 
    logging=TRUE, honk=TRUE
  )
 }
}
\seealso{
\code{\link[=speedtest_plot]{speedtest_plot()}}
}
\keyword{internal}
